from PyQt5.QtWidgets import QApplication, QMainWindow, QPushButton
import sys
from PyQt5.QtCore import QSize, Qt


class MainWindow(QMainWindow):

    def __init__(self):
        super().__init__()

        self.setWindowTitle('My App')

        button = QPushButton('Press Me !!!')
        button.setCheckable(True)
        button.clicked.connect(self.the_button_was_clicked)
        button.clicked.connect(self.the_button_was_clicked)  # test
        button.clicked.connect(self.the_button_was_clicked)  # test
        button.clicked.connect(self.the_button_was_toggled)
        button.clicked.connect(self.the_button_was_toggled)  # test

        self.setMinimumSize(QSize(400, 300))
        self.setMaximumSize(QSize(600, 450))
        self.setCentralWidget(button)

    def the_button_was_clicked(self):
        print('Clicked!')

    def the_button_was_toggled(self, checked):
        print('Checked ?', checked)


app = QApplication(sys.argv)

window = MainWindow()
window.show()

app.exec_()
